home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Systemmonitors
/
Snoopy
/
snoopy.i
< prev
next >
Wrap
Text File
|
1996-09-26
|
9KB
|
255 lines
IFND SNOOPY_I
SNOOPY_I equ 1
IS_LINKABLE equ 1
;-------------- Hi! This is the main includefile for Snoopy and contains
;-------------- some rather "important" informations if you want to modify
;-------------- the code; all data structures are defined in here & loads
;-------------- of comments give you some details not found anywhere else...
;-------------- version/revision information
VERSION equ 2
REVISION equ 0
VERSINFOSTRING equstr _VALOF(VERSION),".",_VALOF(REVISION)
PROGRAMSTRING equstr "Snoopy"
DATE equstr "January 1,1994"
IDSTRING equstr PROGRAMSTRING," ",VERSINFOSTRING," (",DATE,")"
AUTHORSTRING equstr "G.Kurz in 1994"
DEFAULTSCRIPT equstr "s:snoopy.script"
;-------------- defaults for StringToValue()
STVFORMAT_DEC equ 0
STVFORMAT_HEX equ 1
STVFORMAT_OCT equ 2
STVFORMAT_BIN equ 3
;-------------- identifications for StringToValue()
STVTYPE_DEC equ '#'
STVTYPE_HEX equ '$'
STVTYPE_OCT equ '@'
STVTYPE_BIN equ '%'
;-------------- signals the main wait loop uses
MASK_SIGNALS equ SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D|SIGBREAKF_CTRL_E|SIGBREAKF_CTRL_F
;-------------- 4 bytes used as a patch identifier
PATCH_IDSTRING equstr "LOVE"
;-------------- comment identifiers
COMMENT equ ';'
COMMENT_LINE equ '*'
;-------------- all internal limits. Some *REAL* asswipe could redefine these to
;-------------- be like ten times as big each (you know, for those of you with
;-------------- 32 MB of on-board RAM plus some 2.5 GB virtual memory) or
;-------------- make a "tiny snoopy" where everything is just one or two bytes
;-------------- long and in turn completely useless & crap ;-)
MAX_INPUT equ 512
MAX_BASENAME equ 116
MAX_DEFINENAME equ 116
MAX_TASKNAME equ 116
MAX_INCDIRNAME equ 256
MAX_INCLUDELEVEL equ 16
MAX_ALIASNAME equ 120
MAX_ALIASCONTENTS equ 128
MAX_TEMPLATE equ 512
MAX_ARGUMENTS equ 64
MIN_UNITNUMBER equ 0 ; lowest possible unit number
MAX_UNITNUMBER equ 31 ; highest possible unit number
;-------------- structure for keeping library/resource bases
STRUCTURE SnoopyBases,MLN_SIZE
APTR sbase_Library ; also used as pointer to resources
STRUCT sbase_Name,MAX_BASENAME
LABEL sbase_SIZEOF
;-------------- structure for (numeric) defines/bitdefs
STRUCTURE SnoopyDefine,MLN_SIZE
LONG sdef_Offset
STRUCT sdef_Name,MAX_DEFINENAME
LABEL sdef_SIZEOF
;-------------- structure for hide/show tasks
STRUCTURE SnoopyTask,MLN_SIZE
APTR stask_Pointer ; only valid if non-ZERO
STRUCT stask_Name,MAX_TASKNAME
LABEL stask_SIZEOF
;-------------- structure for aliases
STRUCTURE SnoopyAlias,MLN_SIZE
STRUCT salias_Name,MAX_ALIASNAME
STRUCT salias_Contents,MAX_ALIASCONTENTS
LABEL salias_SIZEOF
;-------------- structure for argument definition
STRUCTURE SnoopyArgument,0
UWORD sarg_Opcode
ULONG sarg_Offset ; only valid if opcode supports offset-type
LABEL sarg_SIZEOF
;-------------- the lower 3 bits are reserved for the register number
REGISTER_0 equ %000
REGISTER_1 equ %001
REGISTER_2 equ %010
REGISTER_3 equ %011
REGISTER_4 equ %100
REGISTER_5 equ %101
REGISTER_6 equ %110
REGISTER_7 equ %111
;-------------- supported output types
BITDEF REG,DATA,3 ; register Dx
BITDEF REG,ADDR,4 ; register Ax
BITDEF REG,INDIRECT,5 ; register (Ax,OFFSET) [absolute if none of the above]
BITDEF REG,RESULT,6 ; return value
BITDEF REG,BOOLEAN,7 ; boolean style output
BITDEF REG,BYTE,8 ; size = byte ;;; ****NO SYNTAX CHECKING YET***
BITDEF REG,WORD,9 ; size = word
BITDEF REG,LONG,10 ; size = long
BITDEF REG,ABSOLUTE,11 ; register absolute ;;;; ***UNUSED AS OF YET***
;-------------- special value: end of register template
REG_DONE equ -1
;-------------- structure for library & device patches.
STRUCTURE SnoopyPatch,MLN_SIZE
APTR spatch_Library ; (struct Library *) or (struct Device *)
WORD spatch_Offset ; function offset or IO command
LONG spatch_Flags ; flags for this patch
STRUCT spatch_Template,MAX_TEMPLATE ; output string definition
STRUCT spatch_Arguments,(sarg_SIZEOF*MAX_ARGUMENTS) ; output arguments
LONG spatch_Timeout ; timeout value (for DELAY keyword)
LABEL spatch_SIZEOF
;-------------- if this bit is set, SegTracker output is DISABLED
;-------------- (because default is to ENABLE SegTracker support)
BITDEF SINFO,NOSEGTRACKER,0
;-------------- if this bit is set, Snoopy will skip similar calls; i.e.
;-------------- if calls to the same function are made twice or more times,
;-------------- only the first call is displayed. NOT TASK SENSITIVE!
BITDEF SINFO,SKIPSIMILAR,1
;-------------- the following bits are used only for device patches
BITDEF SINFO,BEGINIO,2 ; show if BeginIO
BITDEF SINFO,ABORTIO,3 ; show if AbortIO
;-------------- if both bits are set, no distinction is made [of course]
;-------------- structure for keeping device bases
STRUCTURE SnoopyDeviceBases,MLN_SIZE
APTR sdevbase_MsgPort
APTR sdevbase_Device
;-------------- this is actually a bitfield (which explains the restriction
;-------------- of up to 31 unit numbers); each bit set represents one unit
;-------------- supported [because the patches apply to all units]. Note that
;-------------- if this field is -1, no unit checking is done => any unit will do
LONG sdevbase_Unit ; default = -1
;-------------- size of the IO block that is required by this device.
;-------------- I didn't want to trust MN_LENGTH, because it seems to be unstable
LONG sdevbase_IOSize ; default = IOSTD_SIZE
;-------------- this structure contains all patches supported for a certain device.
STRUCT sdevbase_Patches,LH_SIZE
STRUCT sdevbase_Name,MAX_BASENAME
LABEL sdevbase_SIZEOF
;-------------- our sexy love connection to SegTracker
STRUCTURE SegSem,SS_SIZE
APTR segs_Find
LABEL segs_SIZEOF
;-------------- the function arguments are stored in a structure like this
STRUCTURE SnoopyRegisters,0
ULONG sregs_D0 ; the data registers
ULONG sregs_D1
ULONG sregs_D2
ULONG sregs_D3
ULONG sregs_D4
ULONG sregs_D5
ULONG sregs_D6
ULONG sregs_D7
ULONG sregs_A0 ; the address registers
ULONG sregs_A1
ULONG sregs_A2
ULONG sregs_A3
ULONG sregs_A4
ULONG sregs_A5
ULONG sregs_A6
ULONG sregs_A7
ULONG sregs_I0 ; indirect address registers
ULONG sregs_I1
ULONG sregs_I2
ULONG sregs_I3
ULONG sregs_I4
ULONG sregs_I5
ULONG sregs_I6
ULONG sregs_I7
LABEL sregs_SIZEOF
;-------------- if this bit is set, its a library/resource kind of message,
;-------------- else its a message from something else
BITDEF MSGTYPE,LIBRARY,0
;-------------- if this bit is set, its a device kind of message, else its
;-------------- a message from something else
BITDEF MSGTYPE,DEVICE,1
;-------------- if this bit is set, it comes from BeginIO(), else from AbortIO()
BITDEF MSGTYPE,BEGINIO,2
;-------------- each patch sends the following message to the main loop
STRUCTURE SnoopyMessage,MN_SIZE ; msgport from exec/ports.i
WORD smsg_Type ; type of message
APTR smsg_Info ; pointer to a SnoopyPatch structure
STRUCT smsg_RegsBeforeCall,sregs_SIZEOF
STRUCT smsg_RegsAfterCall,sregs_SIZEOF
APTR smsg_Task ; the task that called this function
LABEL smsg_SIZEOF
;-------------- device patches send a very minimalistic type-of-message; only this:
STRUCTURE SnoopyDeviceMessage,MN_SIZE ; msgport from exec/ports.i
WORD sdmsg_Type ; type of message
APTR sdmsg_DeviceBase ; (struct SnoopyDeviceBases *)Parent
APTR sdmsg_Task ; (struct Task *)Caller
APTR sdmsg_PC ; for SegTracker support
;-------------- followed by (smsg_DeviceBase->sdevbase_IOSize) bytes of IO memory
LABEL sdmsg_SIZEOF
;-------------- this structure is the top of each library patch
STRUCTURE SnoopyPatchHead,0
ULONG sphead_Ident ; == PATCH_IDSTRING
APTR sphead_Owner ; task who owns this patch
APTR sphead_OriginalFunction ; original function vector
APTR sphead_Info ; pointer to SnoopyPatch/SnoopyDeviceBase
LABEL sphead_SIZEOF
APTR sphead_DevicePtr ; for devices only
LABEL sphead_ExtSIZEOF
;-------------- this structure is the top of each device patch
STRUCTURE SnoopyDevicePatchHead,0
ULONG sdhead_Ident ; == PATCH_IDSTRING
APTR sdhead_Owner ; task who owns this patch
APTR sdhead_OriginalFunction ; original function vector
LONG sdhead_AllocSize ; size of message to allocate
LONG sdhead_Unit ; unit to look out for. This
; is a BITFIELD, which means that
; bit0=unit0, bit1=unit1 and so on...
LABEL sdhead_SIZEOF
;-------------- this bit is set to recognize DEBUG messages
BITDEF MSGTYPE,DEBUG,4
;-------------- a debug message
STRUCTURE SnoopyDebugMessage,MN_SIZE
WORD sumsg_Type
APTR sumsg_Task
APTR sumsg_Template
STRUCT sumsg_RegsBeforeCall,sregs_SIZEOF
STRUCT sumsg_RegsAfterCall,sregs_SIZEOF
LABEL sumsg_SIZEOF
ENDC ;SNOOPY_I
;--------------